package com.zyy.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @Description: 类描述
 * @Author: zyy
 * @Date: 2023/08/05 00:04
 */
public class Test {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        //list.iterator()方法返回的肯定是Iterator接口的子实现类对象
        Iterator<String> iterator = list.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
